<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <div>
        <h3>computed: {{num1}}</h3>
        <h3>computed: {{num1}}</h3>
        <h3>computed: {{num1}}</h3>
        <h3>methods: {{num2()}}</h3>
        <h3>methods: {{num2()}}</h3>
        <h3>methods: {{num2()}}</h3>
      </div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          x: 100,
        },
        computed: {
          num1() {
            return this.x + Math.random();
          },
        },
        mounted() {
          setTimeout(() => {
            this.x = 300;
          }, 5000);
        },
        methods: {
          num2() {
            return Math.random();
          },
        },
      });
    </script>
  </body>
</html>
